package lab03.test03;

import javax.smartcardio.CommandAPDU;
import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {
        //字节流读写文件
        String path = "D:\\test.txt";
        String value = "Beijing欢迎你!";
        FileOutputStream fileOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(path);

            fileOutputStream.write(value.getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally {
            fileOutputStream.close();
        }
        //读文件
        FileInputStream fileInputStream=new FileInputStream(path);
        int tmp;
        while ((tmp=fileInputStream.read()) !=-1){
            System.out.print((char) tmp);
        }
    }


}
